import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/Member/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Member/RegisterView.vue')
  },
  {
    path: '/main',
    name: 'main',
    component: () => import('../views/MainView.vue'),
    children: [
      {
        path: 'user',
        name: 'user',
        component: () => import('../views/User/UserView.vue')
      },
      {
        path: 'rolelist',
        name: 'rolelist',
        component: () => import('../views/Role/RoleView.vue')
      },
      {
        path: 'menulist',
        name: 'menulist',
        component: () => import('../views/Menu/MenuList.vue')
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
